package com.lighthouse.doc.search.domain;

import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.utils.SecurityUtils;
import lombok.Builder;
import lombok.experimental.Accessors;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

/**
 * search对象 lh_rel_doc_search
 * 
 * @author ysz
 * @date 2023-08-15
 */
public class KnowledgeDocSearch extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 用户id */
    private Long userId;

    /** 搜索内容 */
    private String searchInfo;

    /** 搜索时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "搜索时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date searchTime;

    public void setUserId(Long userId) 
    {
        this.userId = userId;
    }

    public Long getUserId() 
    {
        return userId;
    }
    public void setSearchInfo(String searchInfo) 
    {
        this.searchInfo = searchInfo;
    }

    public String getSearchInfo() 
    {
        return searchInfo;
    }
    public void setSearchTime(Date searchTime) 
    {
        this.searchTime = searchTime;
    }

    public Date getSearchTime() 
    {
        return searchTime;
    }

    public KnowledgeDocSearch(String searchInfo) {
        this.searchInfo = searchInfo;
        this.searchTime = new Date();
        this.userId = SecurityUtils.getUserId();
    }

    public KnowledgeDocSearch() {
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("userId", getUserId())
            .append("searchInfo", getSearchInfo())
            .append("searchTime", getSearchTime())
            .toString();
    }
}
